class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println("继承Thread类,重写run方法");
            try{
                Thread.sleep(1000);
            }catch(InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
public class Dome1 {
    public static void main(String[] args) {
        Thread t = new MyThread();
        t.start();
        for (int i = 0; i <5 ; i++) {
            System.out.println("main线程运行结果");
            try{
                Thread.sleep(1000);
            }catch(InterruptedException e){
                throw new RuntimeException(e);
            }
        }
    }
}
